package com.gitee.wsl.ext.number


/** Returns a normalized value considering the given range. This is the opposite of lerp. */
fun inverseLerp(from: Float, to: Float, weight: Float) = (weight - from) / (to - from)

/** Returns a normalized value considering the given range. This is the opposite of lerp. */
fun inverseLerp(from: Double, to: Double, weight: Double) = (weight - from) / (to - from)